#!/bin/bash

# cd project-directory
# Usage: addpkg.sh PKGLIST

# 没整清这个变量的用途，不设置的话不断地有提示信息
export VC_REALNAME=somebody

if [ $# != 2 ]; then
	echo "Usage: addpkg.sh PKGLIST    # change to project directory first"
	exit 1
fi

for f in `cat $1`; do
        osc mkpac $f
        cd $f
        cat >_service <<eof
<services>
        <service name="tar_scm">
                <param name="scm">git</param>
                <param name="url">git@gitee.com:src-openeuler/$f.git</param>
                <param name="revision">openEuler-24.03-LTS-SP1</param>
                <param name="exclude">*</param>
                <param name="extract">*</param>
        </service>
</services>
eof

        osc add _service
        osc commit -n >/dev/null
        cd ..
done >/dev/null

